<template>
	<view>
		<view class="top">
			<view class="top-font">
				退款原因
			</view>
			<view class="top-content">
				<textarea name="" id="" cols="30" rows="10" v-model="font">

				</textarea>
				<uni-file-picker fileMediatype="image" :image-styles="imageStyles" :limit="4" @progress="progress"
					@success="success" @fail="fail" @select="select" />
			</view>
		</view>
		<view class="buttom">
			<view class="button-font">
				选择退款商品
			</view>
			<view class="button-content">
				<!-- v-for="item in 3" -->
				<view class="button-content-area" v-for="(item,index) in csListArrl" :key="index">
					<view class="button-content-area-one">
						<view class="quan" v-if="item.jia">
							<image src="../../static/quan.png" mode="" @click="queding(index)"></image>

						</view>
						<view class="quan" v-else>
							<image src="../../static/isquan.png" mode="" @click="quedingtwo(index)"></image>
						</view>
						<view class="img">
							<image src="../../static/Frame 25.png" mode=""></image>
						</view>
						<view class="button-content-area-one-name">
							香卤翅尖
						</view>
					</view>
					<view class="calculation" v-if="!item.jia">
						<view class="add" @tap="add(index)"></view>
						<text class="num">{{item.num}}</text>
						<view class="sub" @click="sub(index)"></view>
					</view>
					<!-- <view class="application" v-if="item.jia">
						提交申请
					</view>
					<view class="applicationtwo" v-if="!item.jia">
						提交申请
					</view> -->
				</view>
			</view>
		</view>
		<view class="application" v-if="csListArrl.jia">
			提交申请
		</view>
		<view class="applicationtwo" v-if="!csListArrl.jia">
			提交申请
		</view>

	</view>
</template>

<script>
	import {GetRefundOrder} from "@/api/home.js"
	export default {
		onLoad(option) {
			this.orderId = Number(option.orderId) ;
			console.log("this.orderId",this.orderId);
			this.GetRefundOrder()
		},
		data() {
			return {

				font: '炭界面的肌肤',
				orderId:'',
				csListArrl: [{
						jia: true,
						num: 1
					},
					{
						jia: true,
						num: 1
					},
					{
						jia: true,
						num: 1
					},
					{
						jia: true,
						num: 1
					}
				],
				imageStyles: {
					width: 64,
					height: 64,
					border: {
						// color: "#ff5a5f",
						width: 2,
						// style: 'dashed',
						radius: '4rpx'
					}
				},
			};
		},
		methods: {
			//根据orderId获取退款订单
			GetRefundOrder(){
				GetRefundOrder(this.orderId).then(res=>{
					console.log("经济经济",res);
				})
			},
			add(index) {

				if (this.csListArrl[index].num > 3) {
					this.csListArrl[index].num == this.csListArrl[index].num
				} else {
					this.csListArrl[index].num++;
				}
			},
			sub(index) {
				if (this.csListArrl[index].num !== 0) {
					this.csListArrl[index].num--;
					if (this.csListArrl[index].num == 0) {
						this.csListArrl[index].jia = true
					}

				}
			},
			//确定
			queding(index) {
				console.log(222);
				this.csListArrl[index].jia = false
			},
			quedingtwo(index) {
				this.csListArrl[index].jia = true
			},
			// 获取上传状态
			select(e) {
				console.log('选择文件：', e)
			},
			// 获取上传进度
			progress(e) {
				console.log('上传进度：', e)
			},

			// 上传成功
			success(e) {
				console.log('上传成功')
			},

			// 上传失败
			fail(e) {
				console.log('上传失败：', e)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top {
		height: 428rpx;
		width: 702rpx;
		background: #FFFFFF;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		margin-top: 24rpx;
		margin-left: 24rpx;
		display: flex;
		flex-direction: column;

		.top-font {
			font-family: 'PingFang SC';
			font-style: normal;
			font-weight: 1000;
			font-size: 32rpx;
			line-height: 32rpx;
			color: #121B36;
			margin-top: 24rpx;
			margin-left: 24rpx;
		}

		.top-content {
			width: 654rpx;
			height: 300rpx;
			background: #F9F9F9;
			margin-top: 24rpx;
			margin-left: 24rpx;

			textarea {
				width: 630rpx;
				height: 150rpx;
				margin-top: 24rpx;
				margin-left: 24rpx;
				// border: #121B36 1rpx solid;
			}

			uni-file-picker {
				margin-top: 24rpx;
				margin-left: 24rpx;
			}

		}
	}

	/deep/.icon-add {
		width: 40rpx !important;
	}

	.buttom {
		// height: 428rpx;
		width: 702rpx;
		background: #FFFFFF;
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		margin-top: 24rpx;
		margin-left: 24rpx;
		display: flex;
		flex-direction: column;

		.button-font {
			font-family: 'PingFang SC';
			font-style: normal;
			font-weight: 500;
			font-size: 32rpx;
			line-height: 32rpx;
			color: #121B36;
			margin-top: 24rpx;
			margin-left: 24rpx;
		}

		.button-content {
			width: 630rpx;

			// background-color: antiquewhite;
			display: flex;
			flex-direction: column;
			margin-left: 24rpx;

			.button-content-area {
				width: 100%;
				height: 64rpx;
				// background-color: #c2a99d;
				margin-top: 24rpx;
				display: flex;
				margin-bottom: 24rpx;

				.button-content-area-one {
					width: 400rpx;
					display: flex;

					// justify-content: space-around;
					// background-color: #FA8C16;
					.quan {
						width: 62rpx;
						height: 32rpx;
						// margin-left: 24rpx;
						margin-top: 1rpx;
						// text-align: center;

						image {
							width: 32rpx;
							height: 32rpx;
							background-size: 100%;
						}
					}

					.img {
						width: 64rpx;
						height: 64rpx;

						// background-color: #7fbaf9;
						image {
							width: 64rpx;
							height: 64rpx;
							background-size: 100%;
						}
					}

					.button-content-area-one-name {
						height: 64rpx;
						font-family: 'PingFang SC';
						font-style: normal;
						font-weight: 500;
						font-size: 28rpx;
						line-height: 64rpx;
						color: #000000;
						order: 1;
						flex-grow: 0;
						margin-left: 24rpx;
					}
				}

				.calculation {
					display: flex;
					width: 190rpx;
					height: 50rpx;
					// border: 1px solid #D9D9D9;
					border-radius: 35px;
					margin-top: 10rpx;
					margin-left: 50rpx;

					.add {
						margin-left: 20rpx;
						margin-top: 3rpx;
						width: 48rpx;
						height: 48rpx;
						background-image: url("@/static/Frame (8).png");
						background-size: 100%;


					}

					.num {

						width: 22rpx;
						height: 36rpx;
						font-family: 'PingFang SC';
						font-style: normal;
						font-weight: 500;
						font-size: 36rpx;
						line-height: 36rpx;
						color: #FA8C16;
						margin-top: 6rpx;
						margin-left: 20rpx;


					}

					.sub {
						width: 48rpx;
						height: 48rpx;
						background-image: url("@/static/Frame (9).png");
						background-size: 100%;
						margin-top: 3rpx;
						margin-left: 20rpx;

					}

				}

			}
		}
	}

	.application {
		position: fixed;
		bottom: 48rpx;
		margin-left: 50%;
		transform: translate(-50%);
		border: 2rpx solid #8C8C8C;
		border-radius: 12rpx;
		width: 702rpx;
		height: 76rpx;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 800;
		font-size: 36rpx;
		line-height: 76rpx;
		text-align: center;
		color: #8C8C8C;
	}

	.applicationtwo {
		position: fixed;
		bottom: 48rpx;
		margin-left: 50%;
		transform: translate(-50%);
		border: 2rpx solid #FB7A42;
		border-radius: 12rpx;
		width: 702rpx;
		height: 76rpx;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 800;
		font-size: 36rpx;
		line-height: 76rpx;
		text-align: center;
		color: #FB7A42;
	}
</style>
